#include "VolumeRenderPCH.h"
#include "LLOITColorBlendPass.h"
#include "DVRMethodsDef.h"

//**************************************************************************************************
//FUNCTION:
void CLLOITBlendColorPass::initV()
{
	createVAO4ScreenQuad();

	m_pShader = std::make_shared<CShader>("shaders/ScreenQuad_VS.vert", "shaders/LLOIT_ColorBlend_FS.frag");
}

//**************************************************************************************************
//FUNCTION:
void CLLOITBlendColorPass::updateV()
{
#ifdef USING_ALL_METHODS
	if (ResourceManager::getSharedDataByName<EDVRMethod>("DVRMethod") == EDVRMethod::LINKED_LIST_OIT)
#endif
	{
		glBindFramebuffer(GL_FRAMEBUFFER, 0);
		glEnable(GL_BLEND);
		glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);

		glClearColor(0.10f, 0.18f, 0.24f, 1.0f);
		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
		m_pShader->activeShader();
		drawQuad();

		glDisable(GL_BLEND);
		glBindFramebuffer(GL_FRAMEBUFFER, 0);
	}
}
